
//% color="#d72689" iconWidth=50 iconHeight=40
namespace mstimer2{
    //% block="initialization MsTimer2 Execute every [tt] milliseconds " blockType="hat"
    //% tt.shadow="number" tt.defl=500
    export function initialization(parameter: any, block: any) {
        let button = parameter.tt.code;
        //button = replace(button);
        let name = 'msTimer2_func';
            Generator.addInclude('mst', '#include <MsTimer2.h>');
            Generator.addEvent(name, "void", name, "", true);
            Generator.addSetup(`set`, `MsTimer2::set(${button},msTimer2_func);`);
    }

    //% block="MsTimer2 start" blockType="command"
    export function start(parameter: any, block: any) {
        Generator.addCode(`MsTimer2::start();`);
    }

    //% block="MsTimer2 stop" blockType="command"
    export function stop(parameter: any, block: any) {
        Generator.addCode(`MsTimer2::stop();`);
    }


}
